# 初学python练习
# 姓 名：张宇
# 开发时间：2024/07/26 22:20
import re
from re import fullmatch

str ="\t" + "123" + "\n" + "456"
print(str)
print("----------------")


# r'.bc' - 表示一个字符串，有3个字符，第一个字符是任意字符，第2个和第3个分别是b和c
result = fullmatch(r'.bc', '好bc')
print(result)

result = fullmatch(r'x..y', '-8y')
print(result)
print("----------------")


dic = {'key1': 'value1', 'key2': 'value2'}
value = dic.get('key1', 'No value assigned')
print("----------------")

# Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Core/1.94.265.400 QQBrowser/12.7.5765.400
# Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0 "
print("----------------")

heads = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
                  "Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0 "
}
print(heads.get("User-Agent"))
print(type(heads))
print("----------------")

s = "第1章 差役 "
if re.fullmatch(r'第.{0,20}章.{0,100}', s):
    print("yes!!")
s1 = "机会123默默里面"
if re.fullmatch(r'.{5,}', s1):
    print("yes!!")
print("----------------")






